#include <iostream>
#include <boost/assign.hpp>
#include <boost/foreach.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/key_extractors.hpp>
using namespace boost::multi_index;
namespace mi = boost::multi_index;

using namespace std;

int main()
{
    cout << "--- Start ---" << endl;
    
    typedef multi_index_container<int,
            indexed_by<
                ordered_unique<mi::identity<int> >,
                hashed_unique<mi::identity<int> >     
                >
            > mic_t;
    mic_t mic;

    using namespace boost::assign;
    insert(mic) (2), 1, 7, 6, 8;
    assert(mic.size() == 5);
    assert(mic.count(2) == 1);
    assert(mic.find(10) == mic.end());

    mic_t::nth_index<1>::type& hash_index = mic.get<1>();

    BOOST_FOREACH(int i, hash_index) {
        cout << i << ",";
    }
    cout << endl;
    cout << "--- End ---" << endl;
    return 0;
}
